package fr.afcepf.atod.fee.dao.impl;

import java.util.List;

import fr.afcepf.atod.fee.beans.Fee;
import fr.afcepf.atod.fee.dao.IFeeDao;
import fr.afcepf.atod.util.dao.SimpleDao;

public class FeeDao extends SimpleDao implements IFeeDao {

	protected FeeDao() {
		super(Fee.class);
	}

	@Override
	@SuppressWarnings("unchecked")
	public double getFeeByAmount(double _amount) {
		String query = "from Fee where ? between min_amount and max_amount";	
		List<Fee> result = getHibernateTemplate().findByNamedQuery(query, _amount);
		return result.get(0).getFee();
	}

}
